package org.jeecg.modules.tt_question_collect.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.tt_question_collect.entity.TtPlanConfirm;
import org.jeecg.modules.tt_question_collect.entity.TtQuestionCollect;
import org.jeecg.modules.tt_question_collect.entity.TtQuestionFacj;
import org.jeecg.modules.tt_question_collect.entity.tspmodel;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Description: 出具方案表
 * @Author: jeecg-boot
 * @Date:   2021-03-09
 * @Version: V1.0
 */
public interface TtPlanConfirmMapper extends BaseMapper<TtPlanConfirm> {

	@Select("select a.realname,a.id from sys_user a inner join sys_user_role b on a.id = b.user_id and b.role_id = '${otheruserroid}'")
	List<Map<String, Object>> getotheruserlist(@Param("otheruserroid")String otheruserroid);


	Page<TtQuestionFacj> queryquestioncjfa(Page<TtQuestionFacj> pagelist, @Param("ttQuestionCollect")TtQuestionCollect ttQuestionCollect);


	Page<TtQuestionFacj> queryquestionfasp(Page<TtQuestionFacj> pagelist,  @Param("ttQuestionCollect") TtQuestionCollect ttQuestionCollect);


	@Delete("DELETE FROM tt_plan_confirm WHERE plan_questionid = '${id}' ")
	void delete(@Param("id")String id);


	@Select("select * from tt_plan_confirm where plan_questionid = '${questionCode}' ")
	TtPlanConfirm getbyquestionid(@Param("questionCode")String questionCode);

	@Select("select id from sys_role where role_code = 'FANGAN'")
	String getroidByname();

	Page<TtQuestionFacj> questionjiralist(Page<TtQuestionFacj> pagelist,  @Param("ttQuestionCollect")TtQuestionCollect ttQuestionCollect);

}
